/**
 * Created by Administrator on 2017/3/14.
 */
var Input = require('../../../src/libs/input');
var SelectDropDown = require('../../../src/libs/select-drop-down');
var FormItem = require('../../../src/libs/form-item');
var Checkbox = require('../../../src/libs/checkbox');
var HyperLink = require('../../../src/libs/hyperlink');
var RealName = require('../../src/complex/realName');
var GetCode = require('../../../src/libs/get-code');
var Root = React.createClass({
    getInitialState: function () {
      return {
          realName:PageDM.realNameInfo.value
      }
    },
    componentDidMount: function(){
        var _this = this;
        UEventHub.emit("pageLoad","hello world!");
        UEventHub.on(PageDM.realNameInfo.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT, function(v){
            _this.updateRealNameInfoHandler(v);
        });
        UEventHub.on('getcode',function(v){
            this.refs.getCode.toCount();
        }.bind(this));
        UEventHub.on(PageDM.acImgBtn.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT,function(v){
            var _node = this.refs.acImgBtn;
            _node.setAttribute('src',PageDM.acImgBtn.getValue());
        }.bind(this));
    },
    updateRealNameInfoHandler: function (v) {
        var _this = this;
       _this.setState({
           realName:v
       })
    },
    render: function () {
        var _this = this;
        var PageDM = window.PageDM;

        return (
            <div>
                <div className="header">
                    <div className="top-bar fc-light">
                        <div className="container">
                            <span>服务热线：0816-2373017</span>
                            <span>服务时间：工作日 9:00-18:00</span>
                            <span className="nav-right">
                            <a href="登录.html">登录</a>
                            <a href="注册.html">注册</a>
                            <a href="../帮助中心/平台介绍.html">帮助中心</a>
                            <a href="../index.html">返回绵阳商业银行</a>
                        </span>
                        </div>
                    </div>
                    <div className="header-nav">
                        <div className="container">
                            <div className="logo f-left">
                                <a href="../index.html">
                                    <img src="../images/logo.jpg" alt=""/>
                                </a>
                                <a href="../index.html">
                                    <img src="../images/logoe.jpg" alt=""/>
                                </a>
                            </div>
                            <div className="nav f-right">
                                <ul className="clearfix">
                                    <li><a href="../index.html">首页</a></li>
                                    <li><a href="../我要投资.html">我要投资</a></li>
                                    <li><a href="../我要借款.html">我要借款</a></li>
                                    <li><a href="../账户中心/我的账户.html">我的账户</a></li>
                                </ul>
                            </div>
                            <div className="clear"></div>
                        </div>
                        <div className="shadow"></div>
                    </div>
                </div>

                <div className="mod-account container">
                    <div className="sub-nav" ref="realName">
                        <RealName data={this.state.realName}/>
                    </div>
                    <div className="account padding">
                        <div className="bank-card">
                            <div className="title-account"><span>添加银行卡</span></div>
                            <div className="tips fc-main"><i className="iconfont icon-tips"></i>（您所添加的银行账户将用于收取投资本金及收益，请认真填写以下内容，确保其真实性。)</div>
                            <div className="list mod-reg clearfix">
                                <div className="form">
                                    <FormItem label="<span>*</span>开户姓名：" dmbind={PageDM.acName.dmbind}>
                                        <Input placeholder={PageDM.acName.placeholder} dmbind={PageDM.acName.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>身份证号码："  dmbind={PageDM.acIdNum.dmbind}>
                                        <Input placeholder={PageDM.acIdNum.placeholder}  dmbind={PageDM.acIdNum.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>开户行：" dmbind={PageDM.acBankOption.dmbind}>
                                        <SelectDropDown defaultValue={PageDM.acBankOption.selected} options={PageDM.acBankOption.value.options} onChange={PageDM.acBankOption.onChange}  dmbind={PageDM.acBankOption.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>银行账号：" dmbind={PageDM.acBankNum.dmbind}>
                                        <Input placeholder={PageDM.acBankNum.placeholder} dmbind={PageDM.acBankNum.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>确认银行账号：" dmbind={PageDM.acBankNum2.dmbind}>
                                        <Input placeholder={PageDM.acBankNum2.placeholder} dmbind={PageDM.acBankNum2.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>预留手机号码：" dmbind={PageDM.acPhone.dmbind}>
                                        <Input placeholder={PageDM.acPhone.placeholder} dmbind={PageDM.acPhone.dmbind}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>图形验证码：" dmbind={PageDM.acImgCode.dmbind}>
                                        <Input placeholder={PageDM.acImgCode.placeholder} className="ucs-input code" dmbind={PageDM.acImgCode.dmbind}/>
                                        <HyperLink  text={<img src={PageDM.acImgBtn.value} className="f-left img-code" ref="acImgBtn" style={{height:"40px"}}/>} onclick={PageDM.acImgBtn.onClick}/>
                                    </FormItem>
                                    <FormItem label="<span>*</span>短信验证码：" dmbind={PageDM.acMsgCode.dmbind}>
                                        <Input placeholder={PageDM.acMsgCode.placeholder} className="ucs-input code" dmbind={PageDM.acMsgCode.dmbind}/>
                                        <GetCode className="btn btn-code" ref="getCode" count={PageDM.acMsgBtn.count} onClick={PageDM.acMsgBtn.onClick} />
                                        {/*<input type="button" className="btn btn-code btn-code-disabled" value="60秒后重新获取" dmbind={PageDM.acMsgBtn.dmbind}/>*/}
                                    </FormItem>
                                    <div className="check form-group">
                                        <Checkbox checked={PageDM.acCheckbox.value} text="我已阅读并同意" onclick={PageDM.acCheckbox.onClick}  dmbind={PageDM.acCheckbox.dmbind}/>
                                        <a href={PageDM.url.agreement} className="fc-link"> 《 绵阳市商业银行平台服务协议（个人版）》</a>
                                        <div className="tips-error block">请阅读并同意绵阳市商业银行平台服务协议</div>
                                    </div>
                                    <div className="alert-button">
                                        <input type="button" className="btn btn-confirm confirm-addbank" value="确认" onclick={PageDM.aclayer.confirmBack} />
                                    </div>
                                </div>
                                </div>
                        </div>
                    </div>
                    <div className="clear"></div>
                </div>
                <div className="footer">
                    <div className="container">
                        <div className="footer-logo f-left">
                            <p className="logo-foot"><img src="../images/foot-logo.png" alt=""/></p>
                            <p className="txt">
                                2005－2013 绵阳市商业银行股份有限公司
                                <a href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备11013283123号</a>
                            </p>
                        </div>
                        <div className="footer-nav f-right">
                            <div className="col">
                                <h3>关于我们</h3>
                                <ul>
                                    <li><a href="../帮助中心/平台介绍.html">平台介绍</a></li>
                                    <li><a href="../帮助中心/名词解释.html">名词解释</a></li>
                                    <li><a href="../帮助中心/联系我们.html">联系我们</a></li>
                                    <li><a href="../帮助中心/服务协议.html">服务协议</a></li>
                                </ul>
                            </div>
                            <div className="col">
                                <h3>安全保障</h3>
                                <ul>
                                    <li><a href="../帮助中心/安全保障.html">项目安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">资金安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">信息安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">账户安全</a></li>
                                </ul>
                            </div>
                            <div className="col">
                                <h3>帮助中心</h3>
                                <ul>
                                    <li><a href="../帮助中心/投资操作指引.html">投资指引</a></li>
                                    <li><a href="../帮助中心/融资操作指引.html">融资指引</a></li>
                                    <li><a href="../帮助中心/平台公告.html">平台公告</a></li>
                                    <li><a href="javascript:;">常见问题</a></li>
                                </ul>
                            </div>
                            <div className="col col-service">
                                <p>客服专线<br/>0816-2373017</p>
                                <p>服务时间<br/>工作日9:00 - 18:00</p>
                            </div>
                        </div>
                        <div className="clear"></div>
                    </div>
                </div>

            </div>
        )
    }
});
ReactDOM.render(<Root/>, document.getElementById('main'));